<include file="../header" />
<script type="text/javascript">
    function del(id, name) {
        if (!confirm("是否删除企业【" + name + "】")) {
            return false;
        }
        var url = "/admin/Enterprise/delete?id=" + id;
        window.location.href = url;
    }
</script>
<style type="text/css">
	.btn-danger,.btn-info,.btn-success,.btn-warning{
		width: 60px;
		/*height: 18px;*/
		padding: 2px 0px 2px 0px;
		margin: 1px 0px 1px 0px;
	}
</style>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
	<ul class="nav nav-tabs">
		<li class="active"><a href="{:U('Enterprise/index')}">企业列表</a></li>
		<li><a href="{:U('Enterprise/add')}">添加企业</a></li>
	</ul>
	<table class="table table-hover table-bordered">
		<thead>
		<tr>
			<th style="min-width:70px;width:70px;">LOGO</th>
			<th style="min-width:100px;width:300px;">企业信息</th>
			<th style="min-width:50px;width:100px;">部门</th>
			<th style="min-width:630px;width:630px;">矫形器流程</th>
			<th style="min-width:150px;width:150px;">假肢流程</th>
			<th style="min-width:70px;width:70px;">管理操作</th>
		</tr>
		</thead>
		<tbody>

		<foreach name="list" item="vo">
			<tr>
				<td><img src="{$vo.image_url}"/></td>
				<td>
					名称：<a style="color: #00a0e9">{$vo.enterprise_name}</a><br/>
					代码：<a style="color: #00a0e9">{$vo.enterprise_code}</a><br/>
					前缀：<a>{$vo.workorder_no_head}</a>
					<!--创建：{$vo.create_time}<br/>-->
					<!--更新：{$vo.update_time} {$vo.admin_name}-->
				</td>
				<td style="min-width:100px;width:400px;color: #00a0e9">
					<php>
						$roleList = explode(',', $vo["role_list"]);
						$i = 0;
						foreach($allRoleList as $role) {
						if (in_array($role["id"], $roleList)) {
						if($i != 0){
						if($i != 7){
						echo("、 ");
						}else{
						echo("<br/>");
						}
						}
						echo($role["name"]);
						$i++;
						}
						}
					</php>
				</td>
				<php>
					$agentStr = "";
					$agentIdArr = explode(",", $vo["agent_id"]);

					foreach ($agentList as $c) {
					if(in_array($c['agent_id'], $agentIdArr)){
					if(!isNullOrEmpty($agentStr)){
					$agentStr .= "、   ";
					}
					$agentStr .= $c['agent_name'];
					}
					}
				</php>
				<php>
					$orthosisStatusArr=explode(",",$vo["orthosis_process"]);
					$orthosisProcessArr = array("取阴模", "检查取阴模","修阳模","检查修阳模","热塑成型","检查热塑成型","打磨抛光","检查打磨抛光","组装对线","半成品适配","穿戴及使用训练","入库");
					for($i = 0; $i < 12; $i++){
					if($orthosisStatusArr[$i] == "1"){
					$orthosisProcessArr[$i] .= "亮";
					}
					}
				</php>
				<td style="padding: 5px 2px 0px 0px;">
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.0}.png?v={$imgVersion}" title="取阴模"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.1}.png?v={$imgVersion}" title="检查取阴模"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.2}.png?v={$imgVersion}" title="修阳模"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.3}.png?v={$imgVersion}" title="检查修阳模"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.4}.png?v={$imgVersion}" title="热塑成型"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.5}.png?v={$imgVersion}" title="检查热塑成型"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.6}.png?v={$imgVersion}" title="打磨抛光"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.7}.png?v={$imgVersion}" title="检查打磨抛光"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.8}.png?v={$imgVersion}" title="组装对线"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.9}.png?v={$imgVersion}" title="半成品适配"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.10}.png?v={$imgVersion}" title="穿戴及使用训练"/>
						<img class="icon1-img" style="height: 50px;cursor: pointer;" src="/Template/images/{$orthosisProcessArr.11}.png?v={$imgVersion}" title="入库"/>
				</td>

				<php>
					$prosthesisStatusArr=explode(",",$vo["prosthesis_process"]);
					$prosthesisProcessArr = array("接受腔制作", "装配","假肢入库");
					for($i = 0; $i < 3; $i++){
					if($prosthesisStatusArr[$i] == "1"){
					$prosthesisProcessArr[$i] .= "亮";
					}
					}
				</php>
				<td style="padding: 5px 2px 0px 5px;">
						<img style="height: 50px;;cursor: pointer;" src="/Template/images/{$prosthesisProcessArr.0}.png?v={$imgVersion}" onclick='javascript:processPage("{$vo.workorder_id}",1)' title="接受腔制作"/>
						<img style="height: 50px;;cursor: pointer;" src="/Template/images/{$prosthesisProcessArr.1}.png?v={$imgVersion}" onclick='javascript:processPage("{$vo.workorder_id}",2)' title="装配"/>
						<img style="height: 50px;;cursor: pointer;" src="/Template/images/{$prosthesisProcessArr.2}.png?v={$imgVersion}" onclick='javascript:processPage("{$vo.workorder_id}",3)' title="入库"/>
				</td>

				<td style="width:70px;">
					<if condition="$vo['user_id'] eq 1">
						<a class="btn btn-info" disabled="disable">修改</a>

						<else />
						<a class="btn btn-info" href='{:U("Enterprise/edit",array("id"=>$vo["enterprise_id"]))}'>修改</a>

					</if>
					<br/>
					<if condition="$enterprise['level'] eq 0">
						<a class="btn btn-danger" onclick='javascript:del("{$vo.enterprise_id}","{$vo.enterprise_name}")'>删除</a>
					</if>
				</td>
			</tr>
		</foreach>
		</tbody>
	</table>
	<div class="pagination">{$page}</div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>